<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function runAsync1() {
            var p = new Promise(function (resolve, reject) {
                setTimeout(function () {
                    resolve('数据1');
                    return '数据2'
                }, 1000);
            });
            return p;
        };

        function runAsync2() {
            var p = new Promise(function (resolve, reject) {
                setTimeout(function () {
                    resolve('数据3');
                    return '数据4'
                }, 2000);
            });
            return p;
        };

        Promise.all([runAsync1(), runAsync2()])
            .then(function (results) {
                console.log(results);
            })
            .catch(function (reason) {
                console.log(reason);
            })
    </script>
</body>

</html>